﻿@using X.PagedList;
@using X.PagedList.Mvc.Core
@model StaticPagedList<AccountViewModel>  //声明视图模型类型 模型类型是 x.PagedListMvc.core
@{
    ViewBag.Title = "title";
    Layout = "_Layout";
}
<h2>银行案件查询</h2>
<form action="/Account/Search" method="get">
    <span>姓名：</span> @Html.TextBox("DebtorName") 
    <span>银行：</span>@Html.TextBox("BankName") 
    <span>账户状态:</span>
    @Html.DropDownList("AccountState",ViewBag.StateList,"请选择账户状态",null)
    <input type="submit" value="查询" class="btn btn-success"/>
    <a asp-action="Add" class="btn btn-primary">添加</a>
</form>
<table class="table table-primary">
    <thead>
        <tr>
            <th>姓名</th>
            <th>身份证</th>
            <th>银行名称</th>
            <th>状态</th>
            <th>手机号</th>
            <th>业务员</th>
            <th>欠款金额</th>
            <th>操作时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>@item.DebtorName</td>
                <td>@item.IdCard</td>
                <td>@item.BankName</td>
                <td>@item.AccountState.ToString()</td>
                <td>@item.Phone</td>
                <td>@item.SaleMan</td>
                <td>@item.DebtorMoney</td>
                <td>@item.UpdatedTime</td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-link">编辑</a>
                    &nbsp;
                    <a onclick="return confirm('是否真的删除?')" asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>
@Html.PagedListPager(Model,pageIndex=>$"/Account/Search?pageIndex={pageIndex}&pageSize=9")